/**
 * @description 顶部的tab切换组件
 */
import './index.less'
import { Button } from "antd"

function TabWrapper({ hide, tabs, actKey, onTabChange, saveEvent }) {

  return (
    <div className={`tab-wrapper ${hide ? 'hide' : ''}`}>
      {
        tabs.map(item => (
          <Button type={actKey == item.key ? 'primary' : 'default'} key={item.key} onClick={() => onTabChange(item.key)}>{item.label}</Button>
        ))


      }
      <Button type='primary' danger onClick={saveEvent}>保存</Button>
    </div >
  )
}

export default TabWrapper